  <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta charset="utf-8" />
	<title>小傲娇 | 博客标签</title>
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="../media/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="../media/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>
	<link href="../media/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="../media/css/style-metro.css" rel="stylesheet" type="text/css"/>
	<link href="../media/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="../media/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="../media/css/default.css" rel="stylesheet" type="text/css" id="style_color"/>
	<link href="../media/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<!-- END GLOBAL MANDATORY STYLES -->

	<!-- BEGIN PAGE LEVEL STYLES -->
	<link rel="stylesheet" type="text/css" href="../media/css/select2_metro.css" />
	<link rel="stylesheet" href="../media/css/DT_bootstrap.css" />
	<!-- END PAGE LEVEL STYLES -->
	<link rel="shortcut icon" href="../media/image/favicon.ico" />

</head>

<!-- BEGIN BODY -->
<body class="page-header-fixed">

	<!-- BEGIN HEADER -->
	<jsp:include page="../include/admin_head.jsp" />
	<!-- END HEADER -->

	<!-- BEGIN CONTAINER -->
	<div class="page-container row-fluid">
	
		<!-- BEGIN SIDEBAR -->
		<jsp:include page="../include/admin_sidebar.jsp" />
		<!-- END SIDEBAR -->

		<!-- BEGIN PAGE -->
		<div class="page-content">

			<!-- BEGIN PAGE CONTAINER-->        
			<div class="container-fluid">

				<!-- BEGIN PAGE HEADER-->

				<div class="row-fluid">

					<div class="span12">

						<!-- BEGIN STYLE CUSTOMIZER -->
						<jsp:include page="../include/admin_tool.jsp" />						
						<!-- END BEGIN STYLE CUSTOMIZER -->  

						<!-- BEGIN PAGE TITLE & BREADCRUMB-->
						<h3 class="page-title">
							标签库 <small>不明所以得东西不能称之为迷。</small>
						</h3>

						<!-- 导航栏
						<ul class="breadcrumb">
							<li>
								<i class="icon-home"></i>
								<a href="index.html">Home</a> 
								<i class="icon-angle-right"></i>
							</li>
							<li>
								<a href="#">Data Tables</a>
								<i class="icon-angle-right"></i>
							</li>
							<li><a href="#">Editable Tables</a></li>
						</ul>
						 导航栏end -->
						<!-- END PAGE TITLE & BREADCRUMB-->

					</div>

				</div>
				<!-- END PAGE HEADER-->

				<!-- BEGIN PAGE CONTENT-->
				<div class="row-fluid">
					<div class="span12">

						<!-- BEGIN EXAMPLE TABLE PORTLET-->
						<div class="portlet box blue">
							<div class="portlet-title">
								<div class="caption"><i class="icon-edit"></i>标签列表</div>
								<div class="tools">
									<a title="收起" href="javascript:;" class="collapse"></a>									
									<a title="刷新" href="javascript:;" class="reload"></a>								
								</div>
							</div>

							<div class="portlet-body">
								<div class="clearfix">
									<div class="btn-group">
										<button id="sample_editable_1_new" class="btn green" onclick="addTag()">
										添加标签 <i class="icon-plus"></i>
										</button>		
									</div>
									<div class="btn-group" style="float: right;">																		
										<label>
											搜索: <input aria-controls="sample_editable_1" class="m-wrap medium" type="text">
										</label>			
									</div>	
								</div>
								
								<table class="table table-striped table-hover table-bordered" id="">
									<thead>
										<tr>
											<th>编号</th>
											<th>标签名</th>
											<th>描述</th>										
											<th colspan="2">操作</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach var="tag" items="${map.objectList }" varStatus="status">
											<tr class="">
												<td>${tag.id }</td>
												<td>${tag.tagName}</td>				
												<td class="center">${tag.tagDisc}</td>
												<td><a class="edit" href="javascript:;" onclick="editTag(${tag.id })">修改</a></td>
												<td><a class="delete" href="deleteTag.do?id=${tag.id }">删除</a></td>
										   </tr>
	     								</c:forEach>
									</tbody>
								</table>
								<jsp:include page="../include/page.jsp" />
							</div>
						</div>
						<!-- END EXAMPLE TABLE PORTLET-->
					</div>
				</div>
				<!-- END PAGE CONTENT -->
			</div>
			<!-- END PAGE CONTAINER-->
		</div>
		<!-- END PAGE -->
	</div>

	<!-- END CONTAINER -->

	<!-- BEGIN FOOTER -->
	<jsp:include page="../include/admin_foot.jsp" />
	<jsp:include page="../include/tag_model.jsp" />
	<!-- END FOOTER -->

	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->

	<!-- BEGIN CORE PLUGINS -->
	<script src="../media/js/jquery-1.10.1.min.js" type="text/javascript"></script>
	<script src="../media/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
	<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
	<script src="../media/js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>      
	<script src="../media/js/bootstrap.min.js" type="text/javascript"></script>
	<!-- END CORE PLUGINS -->

	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="../media/js/select2.min.js"></script>
	<script type="text/javascript" src="../media/js/jquery.dataTables.js"></script>
	<script type="text/javascript" src="../media/js/DT_bootstrap.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->

	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="../media/js/app.js"></script>
	<script src="../media/js/table-editable.js"></script>    

	<script>
		jQuery(document).ready(function() {       
		   App.init();
		   TableEditable.init();
		   
		   $("#sidebar > li[title='tag']").addClass("start active");
		});
		
		function addTag(){
			$("#updateTag").modal("hide");
			$("#addTag").modal("show");
			
		}
		
		function editTag(id){	
			$.ajax({
				type:"GET",
				url:"getTagById.do",
				dataType:"json",
				data:{
					id:id
				},
				success:function(json){
					$("#updateTag .tagId").val(" ").val(json.id);
					$("#updateTag .tagName").val(" ").val(json.tagName);
					$("#updateTag .tagDisc").val(" ").val(json.tagDisc);
				}
			})
			$("#updateTag").modal("show");
			$("#addTag").modal("hide");
		}

	</script>

<script type="text/javascript">  var _gaq = _gaq || [];  _gaq.push(['_setAccount', 'UA-37564768-1']);  _gaq.push(['_setDomainName', 'keenthemes.com']);  _gaq.push(['_setAllowLinker', true]);  _gaq.push(['_trackPageview']);  (function() {    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);  })();</script>

</body>
<!-- END BODY -->
</html>